package com.px.chapter_Dec_1.logistics;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Execut {
    public static void main(String[] args) {
        ExecutorService pool= Executors.newCachedThreadPool();
        pp ii=new pp();
        Thread thread=new Thread(ii,"1hao");
        Thread thread1=new Thread(ii,"2hao");
        pool.submit(thread);
        pool.submit(thread1);

    }

}
class pp implements Runnable{
    private int aa=1;

    @Override
    public void run() {
        for (;aa<10;aa++)
        System.out.println(Thread.currentThread().getName()+"第"+aa+"张票");
    }
}
